package com.wsu.search.dingshiqi;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class dingshi extends HttpServlet {

	private static final long serialVersionUID = -737034293632526813L;
	private static final String CONTENT_TYPE = "text/html; charset=UTF-8";

	public void init() throws ServletException {
		String path = getServletContext().getRealPath("/");
		System.out.println("start work......");
		// 第一个定时器
		Time ds = new Time();
		ds.startTimer();

		// 第二个定时器 如有需要可开第二个

	}

	// Process the HTTP Get request
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType(CONTENT_TYPE);
		PrintWriter out = response.getWriter();
		out.println("<html>");
		out.println("<head><title>Servlet1</title></head>");
		out.println("<body bgcolor=\"#ffffff\">");
		out.println("<p> 执行doGet </p>");
		out.println("</body></html>");

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

	}

	// Clean up resources
	public void destroy() {
	}
}
